package org.example.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author limeng
 * @create 2021-05-25 16:50
 */
@RestController
public class ProductController {

    private static final Logger log = LoggerFactory.getLogger(ProductController.class);

    @Value("${server.port}")
    private Integer port;

    @GetMapping("/product/test/{id}")
    public String test(@PathVariable("id") Integer id) {
        log.info("id:{}", id);
        return "商品服务返回id：" + id + ",商品服务端口为：" + port;
    }
}
